<html>
<head><meta charset="utf-8"><title>Option to emit linker command line? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html">Option to emit linker command line?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187847513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187847513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187847513">(Feb 10 2020 at 19:06)</a>:</h4>
<p>I remember using an option to rustc (and cargo) that got it to print the <code>cc</code> command line it uses for linking, before invoking it. I can't seem to find that option anymore. What option do I need to pass to get rustc to print its linker command line before linking?</p>



<a name="187847759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187847759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187847759">(Feb 10 2020 at 19:09)</a>:</h4>
<p>Maybe <code>-v</code> helps? Otherwise use <code>-Clinker=false</code> to make rustc print the arguments after <code>/bin/false</code> exits with an error code.</p>



<a name="187848118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848118">(Feb 10 2020 at 19:12)</a>:</h4>
<p><code>-v</code> doesn't show the linker arguments, unfortunately.</p>



<a name="187848143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848143">(Feb 10 2020 at 19:12)</a>:</h4>
<p>I just managed to find <code>-Z print_link_args</code>, which works on nightly.</p>



<a name="187848170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848170">(Feb 10 2020 at 19:13)</a>:</h4>
<p>Was there a time when <code>-v</code> printed the linker arguments? Because I remember this not being nightly only.</p>



<a name="187848202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848202">(Feb 10 2020 at 19:13)</a>:</h4>
<p>it might be a -Z flag</p>



<a name="187848211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848211">(Feb 10 2020 at 19:13)</a>:</h4>
<p>oh yeah you found it</p>



<a name="187848226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848226">(Feb 10 2020 at 19:13)</a>:</h4>
<p>(<code>-Z print-link-args</code>, namely)</p>



<a name="187848309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Option%20to%20emit%20linker%20command%20line%3F/near/187848309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Option.20to.20emit.20linker.20command.20line.3F.html#187848309">(Feb 10 2020 at 19:14)</a>:</h4>
<p>I remember this <em>not</em> being a nightly thing, though. Did rustc at some point print the linker command line with <code>-v</code> and then stop doing so?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>